export default function debounce (fn, wait) {
    let timer
    return function () {
        if (timer) {
            clearTimeout(timer)
        }
        let context = this
        let args = [...arguments]
        setTimeout(() => {
            fn.apply(context, args)
        }, wait);
    }
}